package com.mav.controller;

import com.mav.pojo.ClazzOption;
import com.mav.pojo.JobOption;
import com.mav.pojo.Result;
import com.mav.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    ReportService reportService;
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        log.info("统计员工人数");
       JobOption jobOption = reportService.getEmpJobData();
       return Result.success(jobOption);
    }
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        log.info("统计员工性别信息");
        List<Map<String, Object>> genderData=reportService.getEmpGenderData();
        return Result.success(genderData);
    }
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        log.info("统计学生学历信息");
        List<Map<String,Object>> studentDegreeData=reportService.getStudentDegreeData();
        return Result.success(studentDegreeData);
    }
    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        log.info("统计各班级学生信息");
        ClazzOption clazzOption=reportService.getStudentCountData();
        return Result.success(clazzOption);
    }

}
